<html>
<head><meta charset="utf-8"><title>Port on AIX · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html">Port on AIX</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="223645196"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/223645196" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#223645196">(Jan 22 2021 at 14:07)</a>:</h4>
<p>Hi,<br>
I am porting rust on AIX. LLVM support of AIX is partial, especially on LLVM 11.<br>
Some needed functionalities has been added on LLVM 12, but it seems Rust cannot compile with LLVM 12.<br>
Can you confirm it is not currently possible to compile Rust with LLVM 12? If so, do you have an idea of the date when it will be possible (LLVM 12 will be  released on March)?<br>
Thanks!</p>



<a name="223645987"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/223645987" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#223645987">(Jan 22 2021 at 14:14)</a>:</h4>
<p>you can add support for LLVM12 yourself if its time sensitive; otherwise its generally done when we bump our llvm submodule to a new version.</p>



<a name="223646226"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/223646226" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#223646226">(Jan 22 2021 at 14:16)</a>:</h4>
<p>Thanks. I will have a look to add LLVM 12 support. If you have tips, it will be welcome. :)</p>



<a name="223648701"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/223648701" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#223648701">(Jan 22 2021 at 14:37)</a>:</h4>
<p>should mostly involve changes to rustllvm wrapper.</p>



<a name="224693005"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/224693005" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#224693005">(Feb 01 2021 at 07:31)</a>:</h4>
<p>Is this for personal use, or for work purposes?</p>



<a name="224693012"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/224693012" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#224693012">(Feb 01 2021 at 07:31)</a>:</h4>
<p>If the latter, you may also want to look at the target tier policy.</p>



<a name="224732541"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/224732541" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> LingM <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#224732541">(Feb 01 2021 at 14:26)</a>:</h4>
<p>btw, work to add support for LLVM 12 is underway here: <a href="https://github.com/rust-lang/rust/pull/81451">https://github.com/rust-lang/rust/pull/81451</a></p>



<a name="224742923"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/224742923" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#224742923">(Feb 01 2021 at 15:35)</a>:</h4>
<p>It is for work purpose. I am a member of the <a href="http://www.bullfreeware.com/">http://www.bullfreeware.com/</a> team.<br>
I will test the PR 81451, as my own try has some trouble.</p>



<a name="225165131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225165131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225165131">(Feb 04 2021 at 14:23)</a>:</h4>
<p>It works with the PR. I have generated assembly files from a Rust file using a custom rustc.<br>
However, LLVM 12 is not able to compile LLVM-Assembly to object or binaries for AIX (and this functionality is not planned soon). If I understand correctly, Rust produces by default LLVM-Assembly, and calls LLVM to produce object or binary. As Rust can generate native Assembly files, is there a flag to force Rust to produce native assembly and to call LLVM with this assembly file? Moreover, is there a way to specify assembler (to redirect to an AIX machine, and use, eg, GCC on AIX to transform assembly into binaries)? I have found for linker, but not for assembler.</p>



<a name="225170614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225170614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225170614">(Feb 04 2021 at 15:03)</a>:</h4>
<p>I don't think rustc can generate assembly directly, it goes through LLVM even in debug mode</p>



<a name="225170720"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225170720" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225170720">(Feb 04 2021 at 15:04)</a>:</h4>
<p>I think there are people working on a GCC backend but I haven't heard anything about it in a very long time</p>



<a name="225171109"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225171109" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225171109">(Feb 04 2021 at 15:06)</a>:</h4>
<p>"call LLVM with the assembly file"? what exactly would this do?</p>



<a name="225171164"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225171164" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225171164">(Feb 04 2021 at 15:06)</a>:</h4>
<p>Can LLVM output <em>assembly</em> for AIX? Then you're good, or would be if we didn't remove the "use an external assembler" feature</p>



<a name="225171193"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225171193" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225171193">(Feb 04 2021 at 15:07)</a>:</h4>
<p>This used to be how msp430 support worked</p>



<a name="225171307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225171307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225171307">(Feb 04 2021 at 15:07)</a>:</h4>
<p>hmm, but isn't AIX an OS? what's the actual architecture you're targeting?</p>



<a name="225172582"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225172582" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225172582">(Feb 04 2021 at 15:15)</a>:</h4>
<p>AIX is an OS on powerpc64, but Linux power assembly and Linux power assembly are not compatible.</p>
<p>I can generate assembly for AIX on Linux by:<br>
$ rustc &lt;file&gt; --emit asm --target powerpc64-ibm-aix </p>
<p>I can compile the assembly file generated in an AIX machine:<br>
$ gcc -c file.s  -o file.o -maix64</p>
<p>But I cannot compile the assembly file directly on Rust:<br>
$ rustc &lt;file&gt; --emit obj --target powerpc64-ibm-aix <br>
LLVM ERROR: 64-bit XCOFF object files are not supported yet.</p>
<p>It is a known limitation of LLVM: we cannot create object from LLVM assembly for AIX.</p>



<a name="225172870"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225172870" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225172870">(Feb 04 2021 at 15:17)</a>:</h4>
<p>As rustc can (through LLVM) generate native AIX assembly file and this can be used to create object files, I want to workaround LLVM limitation.</p>



<a name="225173784"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225173784" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225173784">(Feb 04 2021 at 15:23)</a>:</h4>
<p>Try --emit=llvm-bc</p>



<a name="225173805"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225173805" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225173805">(Feb 04 2021 at 15:23)</a>:</h4>
<p>Or something like that, I forget the exact flag</p>



<a name="225173960"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225173960" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225173960">(Feb 04 2021 at 15:24)</a>:</h4>
<p>we used to have the no_integrated_as option, but it was removed in <a href="https://github.com/rust-lang/rust/pull/70345">https://github.com/rust-lang/rust/pull/70345</a></p>



<a name="225174356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225174356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225174356">(Feb 04 2021 at 15:27)</a>:</h4>
<p>LLVM 12 does not support LLMV bytecode on AIX. That's the trouble. I cannot transform LLVM bytecode to AIX object. I can transform native assembly generated by LLVM to AIX object.</p>



<a name="225174430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225174430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225174430">(Feb 04 2021 at 15:27)</a>:</h4>
<p>yeah, using an external assembler sounds like what you want then, which is what no_integrated_as did</p>



<a name="225174574"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225174574" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225174574">(Feb 04 2021 at 15:28)</a>:</h4>
<p>Rust seems to go thought LLVM bytecode, whereas it will be OK if it can be forced to go through native assembly (correctly generated!).</p>
<p>OK about no_integrated_as. I will check if I can restore this functionality.</p>



<a name="225174811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225174811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225174811">(Feb 04 2021 at 15:30)</a>:</h4>
<p>Patch seems not so big.<br>
If it is OK, maybe it can be a good idea to create a PR to add it again, as this code seems useful for porting new OS.</p>



<a name="225175101"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225175101" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225175101">(Feb 04 2021 at 15:32)</a>:</h4>
<p>It will probably be needed on AIX one or two years, while LLVM bytecode to object is not implemented on AIX.</p>



<a name="225175637"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Port%20on%20AIX/near/225175637" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Etienne Guesnet <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Port.20on.20AIX.html#225175637">(Feb 04 2021 at 15:36)</a>:</h4>
<p>Thanks a lot for your response, <span class="user-mention" data-user-id="211727">@Jonas Schievink</span>!</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>